package com.ease.component.skins {
   import flash.display.Graphics;

   import mx.controls.TextInput;
   import mx.core.mx_internal;
   import mx.skins.halo.HaloBorder;

   use namespace mx_internal;
/**
 *  A customed Border Skin which have thicker error border
 *
 */
public class AuroraBorder extends HaloBorder {
    mx_internal override function draw3dBorder(c1:Number, c2:Number, c3:Number,
                                      c4:Number, c5:Number, c6:Number):void {
       var parentTextInput:TextInput = parent as TextInput;
       if (parent == null || parentTextInput == null ||
            parentTextInput.errorString == null || parentTextInput.errorString == "") {
          super.draw3dBorder(c1,c2,c3,c4,c5,c6);
          return;
       }
       var w:Number = width;
       var h:Number = height;

       drawDropShadow(0, 0, width, height, 0, 0, 0, 0);

       var g:Graphics = graphics;

       // outside sides
       g.beginFill(c1);
       g.drawRect(0, 0, w, h);
       g.drawRect(2, 0, w - 4, h);
       g.endFill();

       // outside top
       g.beginFill(c2);
       g.drawRect(2, 0, w - 4, 2);
       g.endFill();

       // outside bottom
       g.beginFill(c3);
       g.drawRect(2, h - 2, w - 2, 2);
       g.endFill();

       // inside top
       g.beginFill(c4);
       g.drawRect(2, 2, w - 4, 2);
       g.endFill();

       // inside bottom
       g.beginFill(c5);
       g.drawRect(2, h - 4, w - 4, 2);
       g.endFill();

       // inside sides
       g.beginFill(c6);
       g.drawRect(2, 4, w - 4, h - 8);
       g.drawRect(4, 4, w - 8, h - 8);
       g.endFill();
    }
}
}
